<template>
  <div>
<h2>显示页面</h2>
项目名称:<input type="text" v-model="state.name">
理财收益:<input type="text" v-model="state.minmoney">--<input type="text" v-model="state.maxmoney">
<input type="button" value="查询" @click="show">
<table>
  <tr>
    <td>理财编号</td>
    <td>项目名称</td>
    <td>年收益</td>
    <td>月收益</td>
    <td>最低金额</td>
    <td>理财人数</td>
    <td>风险等级</td>
    <td>利息编号</td>
  </tr>
  <tr v-for="item in list" :key="item.I_Id">
    <td>{{ item.I_Id }}</td>
    <td>{{ item.I_Name }}</td>
    <td>{{ item.I_Year }}</td>
    <td>{{ item.I_Month }}</td>
    <td>{{ item.I_MinMoney }}</td>
    <td>{{ item.I_Number }}</td>
    <td>{{ item.I_Top }}</td>
    <td>{{ item.L_Name }}</td>
  </tr>
</table>
  </div>
</template>

<script setup lang="ts">
import axios from 'axios';
import {reactive,toRefs,onMounted} from 'vue'
import { useRouter } from 'vue-router';
const router = useRouter()

onMounted(()=>{
  show()
})

const data:any=reactive({
  list:[],
  state:{
    name:'',
    minmoney:'',
    maxmoney:''
  }
})

let {list,state} =toRefs(data)

const show=()=>{
  axios({
    url:'http://localhost:62519/api/Default/GetShowInvest',
    method:'get',
    params:state.value
  }).then(res=>{
console.log(res)
list.value=res.data.data
  }).catch(err=>{
console.log(err)
  })
}




</script>

<style scoped>

</style>